﻿using System;
using UnityEngine;

// Token: 0x02000161 RID: 353
public class AttachWear : MonoBehaviour
{
	// Token: 0x06000945 RID: 2373 RVA: 0x0003675C File Offset: 0x0003495C
	private void Awake()
	{
		if (this.baseBoneRoot == null)
		{
			return;
		}
		AttachBoneWeight.Attach(this.baseBoneRoot, base.gameObject, true);
		DynamicBone[] componentsInChildren = base.GetComponentsInChildren<DynamicBone>(true);
		DynamicBoneCollider[] componentsInChildren2 = this.baseBoneRoot.GetComponentsInChildren<DynamicBoneCollider>(true);
		foreach (DynamicBone dynamicBone in componentsInChildren)
		{
			string name = dynamicBone.m_Root.name;
			Transform root = Transform_Utility.FindTransform(this.baseBoneRoot.transform, name);
			dynamicBone.m_Root = root;
			dynamicBone.m_Colliders.Clear();
			foreach (DynamicBoneCollider item in componentsInChildren2)
			{
				dynamicBone.m_Colliders.Add(item);
			}
		}
	}

	// Token: 0x04000905 RID: 2309
	public GameObject baseBoneRoot;
}
